#include <header.h>

int num = -1;
void func(int sig_value){
    printf("sig_value: %d \n", sig_value);
}
int main(int argc,char*argv[])
{
    signal(SIGALRM, func);

    struct itimerval timer;
    memset(&timer, 0, sizeof(timer));

    timer.it_value.tv_sec = 5;
    timer.it_value.tv_usec = 0;

    timer.it_interval.tv_sec = 1;
    timer.it_interval.tv_usec = 0;

    setitimer(ITIMER_REAL, &timer, NULL);

    // 感知到 定时到时间了 -> 
    while(1);
    return 0;
}